/// <reference path="../../Gen/Typing/csharp/index.d.ts"/>
import "reflect-metadata";
import Debug = CS.UnityEngine.Debug;

const Prop = (): PropertyDecorator => {
    return (target, key: string) => {
        const _type = Reflect.getMetadata('design:type', target, key)
        Debug.Log("type: " + _type)
    }
}

const Method = (): MethodDecorator => {
    return (traget: any, propertyKey: string, descriptor: PropertyDescriptor) => {
        const _params = Reflect.getMetadata('design:paramtypes', traget, propertyKey)
        Debug.Log('params: ' + _params)
    }
}

const GetReturn = (): MethodDecorator => {
    return (traget: any, propertyKey: string, descriptor: PropertyDescriptor) => {
        const _return = Reflect.getMetadata('design:returntype', traget, propertyKey)
        Debug.Log('return type: ' + _return) 
    }
}

class TestReflect {
    @Prop()
    public name: String

    @GetReturn()
    public getName (): String {
        return this.name
    }

    @Method()
    public setName (name: String) {
        this.name = name
    }


    public GetLink() : any {
        return { a : 123 }
    }
}


let testReflect = new TestReflect() as any;

// testReflect.asd = 456;

Debug.Log("123")

